/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.meteocal.entity;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 *
 * @author paolo
 */
@Entity
public class MessageList implements Serializable {
    
    private static final long serialVersionUID = 1L;
   
    /*ATTRIBUTE*/
    
    @EmbeddedId
    protected MessageListPK messageListPK;
    private Boolean pending;
    
    /*RELATIONSHIP*/
    
    //MESSAGELIST-MESSAGE
    @JoinColumn(name = "message", referencedColumnName = "messageID", insertable = false, updatable = false)
    @ManyToOne
    private Message message;
    
    //MESSAGELIST-USER
    @JoinColumn(name = "user", referencedColumnName = "email", insertable = false, updatable = false)
    @ManyToOne
    private User user;

    public MessageListPK getMessageListPK() {
        return messageListPK;
    }

    public void setMessageListPK(MessageListPK messageListPK) {
        this.messageListPK = messageListPK;
    }

    public Boolean getPending() {
        return pending;
    }

    public void setPending(Boolean pending) {
        this.pending = pending;
    }

    public Message getMessage() {
        return message;
    }

    public void setMessage(Message message) {
        this.message = message;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
